﻿using System;
using System.Diagnostics;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Xml.Linq;
using Microsoft.Xna.Framework.Input;

namespace chemicall
{
    public class PauseMenu : MenuScreen
    {
        public PauseMenu()
            : base("Pause")
        {
            this.IsPopup = true;
            MenuItem playGameMenuEntry = new MenuItem("Revenir");
            MenuItem exitMenuEntry = new MenuItem("Quitter");

            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }

        void PlayGameMenuEntrySelected(object sender, System.EventArgs e)
        {
            this.ScreenManager.CurrentScreen = this.ScreenManager.LastScreen;
            this.ScreenManager.LastScreen = this;
            this.ScreenManager.CurrentScreen.myPause.Paused = false;
        }

        protected override void OnCancel(PlayerIndex playerIndex)
        {
            ScreenManager.Game.Exit();
        }
    }
}
